/*
 * Copyright (C) Francisco Morero Peyrona. All rights reserved.
 *
 * This software is published under the terms of Open Source
 * License version 1.1, a copy of which has been included with this
 * distribution in the License.txt file.
 */

package jdbcmanager.swing;

import java.awt.*;
import javax.swing.*;

/**
 * 
 * @author Francisco Morero Peyrona
 */

public class JxSpinner extends JSpinner
{
   /**
    * 
    */
   public JxSpinner()
   {
      super();
      init();
   }

   /**
    * @param model
    */
   public JxSpinner( SpinnerModel model )
   {
      super( model );
      init();
   }

   /**
    * 
    */
   public void setFont( Font font )
   {
      getTextField().setFont( font );      
   }
   
   /**
    * 
    */
   public void setToolTipText( String sText )
   {
      getTextField().setToolTipText( sText );
   }
   
   //-------------------------------------------------------------------------//
   
   private JFormattedTextField getTextField()
   {
      JSpinner.DefaultEditor editor = (JSpinner.DefaultEditor) getEditor();      
            
      return editor.getTextField();
   }
   
   private void init()
   {
      setFont( UIManager.getFont( "Spinner.font" ) );
   }
}
